

#import <Foundation/Foundation.h>
#import "BaseResponse.h"

typedef int RequestID;

@protocol ServerCommunicationDelegate <NSObject>
@required
/**
 * @param response TMBaseResponse中包含了Request请求，应用层可以根据request或request中的requestid来比较某个请求的返回
 * 调用该回调函数时满足   errorType = NO_ERROR && ret = RET_SUCCESS;
 */
- (void)onRequestSuccess:(BaseResponse*)response;

/**
 * @param response TMBaseResponse中包含了Request请求，应用层可以根据request或request中的requestid来比较某个请求的返回
 * 调用该回调函数时满足   errorType != NO_ERROR || ret != RET_SUCCESS;
 */
- (void)onRequestFail:(BaseResponse*)response;
@end
